home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Caml Light 0.61 / Source / src / compiler / prim.ml < prev    next >
Encoding:
Text File  |  1993-09-24  |  1.0 KB  |  50 lines  |  [TEXT/MPS ]

  1. (* The type of primitives *)
  2.  
  3. #open "const";;
  4.  
  5. type primitive =
  6.     Pidentity
  7.   | Pget_global of qualified_ident
  8.   | Pset_global of qualified_ident
  9.   | Pdummy of int
  10.   | Pupdate
  11.   | Ptest of bool_test
  12.   | Pmakeblock of constr_tag
  13.   | Ptag_of
  14.   | Pfield of int
  15.   | Psetfield of int
  16.   | Pccall of string * int
  17.   | Praise
  18.   | Pnot
  19.   | Pnegint | Psuccint | Ppredint
  20.   | Paddint | Psubint | Pmulint | Pdivint | Pmodint
  21.   | Pandint | Porint | Pxorint
  22.   | Pshiftleftint | Pshiftrightintsigned | Pshiftrightintunsigned
  23.   | Pincr | Pdecr
  24.   | Pintoffloat
  25.   | Pfloatprim of float_primitive
  26.   | Pstringlength | Pgetstringchar | Psetstringchar
  27.   | Pmakevector | Pvectlength | Pgetvectitem | Psetvectitem
  28.  
  29. and float_primitive =
  30.     Pfloatofint
  31.   | Pnegfloat | Paddfloat | Psubfloat | Pmulfloat | Pdivfloat
  32.  
  33. and bool_test =
  34.     Peq_test
  35.   | Pnoteq_test
  36.   | Pint_test of int prim_test
  37.   | Pfloat_test of float prim_test
  38.   | Pstring_test of string prim_test
  39.   | Pnoteqtag_test of constr_tag
  40.  
  41. and 'a prim_test =
  42.     PTeq
  43.   | PTnoteq
  44.   | PTnoteqimm of 'a
  45.   | PTlt
  46.   | PTle
  47.   | PTgt
  48.   | PTge
  49. ;;
  50.